As You Type ContextMenuStrip Customization

To use the spell checker's suggestion items in an externally provided ContextMenu(Strip)

  1. Set RapidSpellAsYouType.ShowSuggestionsContextMenu = false
  2. Set RapidSpellAsYouType.ShowCutCopyPasteOnTextBoxBase = false (if working with a .NET TextBox)
  3. Add a ContextMenuStrip to the form and assign it to the text editor and handle it's Opening event
  4. In the event handler, use GetSuggestionsToolStripItems to obtain spelling suggestions and construct the menu.
            private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
            {
                //clear any old suggestions, leaving the first two menu items which we don't want to clear
                if (contextMenuStrip1.Items.Count > 2)
                    while (contextMenuStrip1.Items.Count > 2)
                        contextMenuStrip1.Items.RemoveAt(2);
    
                //grab the suggestions from the spell checker
                ToolStripItem[] suggestions = rapidSpellAsYouType1.GetSuggestionsToolStripItems();
    
                //if there are suggestions (ie if the click was on an error), show them
                if (suggestions != null)
                {
                    contextMenuStrip1.Items.Add(new ToolStripSeparator());
                    contextMenuStrip1.Items.AddRange(suggestions);
                }
            }
    

To use a ContextMenu(Strip) when user clicks away from an error

  1. Set RapidSpellAsYouType.ShowSuggestionsContextMenu = true
  2. Use the AYTTextBox or AYTRichTextBox control for the textbox, instead of the standard .NET textboxes
  3. Add a ContextMenuStrip to the form, if not already present
  4. Set ContextMenuStripDefault in AYTTextBox or AYTRichTextBox to the ContextMenuStrip to be shown when the user right clicks away from an error